﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RecordDataTable.ascx.cs"
    Inherits="ECGWeb.Controls.DataTable" %>
<link href="../Style/TableStyle.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
<script src="../Scripts/myDrawGraph.js" type="text/javascript"></script>
<asp:UpdatePanel ID="recordUpdatePanel" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="record_gridview" EventName="pageindexchanging" />
    </Triggers>
    <ContentTemplate>
        <div class="doctor_record_gridview_div">
            <asp:GridView ID="record_gridview" runat="server" AllowPaging="true" ClientIDMode="Static"
                AllowSorting="true" CssClass="GridViewStyle" GridLines="None" PageSize="5" AutoGenerateColumns="false">
                <Columns>
                    <asp:BoundField DataField="RecordID" HeaderText="Mã bản ghi" />
                    <asp:BoundField DataField="DateTimeOfRecord" HeaderText="Ngày giờ" />
                </Columns>
                <RowStyle CssClass="RowStyle" />
                <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                <PagerStyle CssClass="PagerStyle" />
                <SelectedRowStyle CssClass="SelectedRowStyle" />
                <HeaderStyle CssClass="HeaderStyle" />
                <EditRowStyle CssClass="EditRowStyle" />
                <AlternatingRowStyle CssClass="RowStyle" />
            </asp:GridView>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

<script type="text/javascript">
    //Sự kiện khi click một dòng của record_gridview
    $('.RowStyle').click(function () {
        //Dịch trang đến vị trí vẽ
        $('html, body').animate({
            scrollTop: $("#recordDetail").offset().top
        }, 800);
        recordid = $(this).children().eq(0).html();

        /*************************************/
        //Load dữ liệu một lần
        //loadData12($(this).children().eq(0).html());
        /*************************************/

        /*************************************/
        //Thu nghiep load tung phan
        if (request != null) {
            var executor = request.get_executor();
            if (executor.get_started()) {
                executor.abort();
            }
        }
        loadAFrame(recordid);
        /*************************************/
    });  
</script>
